<?php

class Notification_Table_Model_Notification extends Database_Model_Item
{

	/**
	 * @var string
	 */
	protected $_pk = 'notification_id';
	

	protected $_itemType = 'notification';

	/**
	 * @return int
	 */
	function getId()
	{
		return $this -> notification_id;
	}

	/**
	 * @return string
	 */
	function getTitle()
	{
		return $this->getObject()->getTitle();
	}

	/**
	 * @return model
	 */
	function getContent()
	{
		$spec = Nuo::getApi('notification') -> getTypeSpec($this -> type_id);

		list($module, $method) = explode(':', $this -> type_id);

		// plese using this content by compiler.
		return Nuo::getView()->render($module . '/view/partial/notification/' . $method, array(
			'item' => $this,
			'spec' => $spec
		));
	}

}
